﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using VAdvantage.WindowMigration;

namespace VAdvantage.DataBase
{
    /// <summary>
    /// Gets the Currently configured database with the current application
    /// </summary>
    public static class DatabaseType
    {
        /** Supported Databases     */
        public static String[] DB_NAMES = new String[] {
		VEnvironment.DBTYPE_PG,
		VEnvironment.DBTYPE_ORACLE,
		VEnvironment.DBTYPE_MS
	};

        #region Used Database Properties
        /// <summary>
        /// To check if Used Databae is MySQL
        /// </summary>
        public static bool IsMySql
        {
            get
            {
                //if (!DataBase.DB.UseMigratedConnection)
                //{
                //    if (VConnection.Get().IsMysql())
                //        return true;
                    return false;

               // }
                //else
                //{
                    //if (MDialog.GetMConnection().IsMysql())
                    //{
                    //    return true;
                    //}
                    return false;
                //}
            }
        }

        /// <summary>
        /// To check if Used Databae is MSSQL
        /// </summary>
        public static bool IsMSSql
        {
            get
            {
                //if (!DataBase.DB.UseMigratedConnection)
                //{
                //    if (VConnection.Get().IsMSSQLServer())
                //        return true;
                    return false;
                //}
                //else
                //{
                //    if (MDialog.GetMConnection().IsMSSQLServer())
                //    {
                //        return true;
                //    }
                  //  return false;
                //}
            }
        }

        /// <summary>
        /// To check if Used Databae is Postgre SQL
        /// </summary>
        public static bool IsPostgre
        {
            get
            {
                //if (!DataBase.DB.UseMigratedConnection)
                //{
                //    if (VConnection.Get().IsPostgreSQL())
                //        return true;
                //    return false;

                //}
                //else
                //{
                    //if (MDialog.GetMConnection().IsPostgreSQL())
                    //{
                    //    return true;
                    //}
                    return false;
                //}
            }
        }

        /// <summary>
        /// To check if Used Databae is Oracle
        /// </summary>
        public static bool IsOracle
        {
            get
            {
                //if (!DataBase.DB.UseMigratedConnection)
                //{
                //    if (VConnection.Get().IsOracle())
                //        return true;
                //    return false;

                //}
                //else
                //{
                //    if (MDialog.GetMConnection().IsOracle())
                //    {
                        return true;
                //    }
                //    return false;
                //}
            }
        }



        #endregion
    }
}
